<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>002</title>
</head>
<body>

    <script type="text/javascript">
    
        window.onload = function() {
            document.getElementById("btn1").onclick = function() {
                window.close();
            }
            document.getElementById("btn2").onclick = function() {
                if(window.self != window.top) {
                    window.top.location = window.self.location;
                }
            }
        }    


    </script>

    <input type="button" value="关闭" id = "btn1">

    <input type="button" value="top" id="btn2">
    
</body>
</html>